﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;

namespace CDSBDemandControlService
{
    public partial class CDSBDemandControlService : ServiceBase
    {
        ClassePrincipal cp;

        public CDSBDemandControlService()
        {
            cp = new ClassePrincipal();
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            Thread thr = new Thread(new ThreadStart(cp.Run));
            thr.Start();
        }

        protected override void OnStop()
        {
            cp.Dispose(true);
        }
    }
}
